<template>
  <span :style="{ color: res.color, marginRight: '10px' }">
    {{ idx + 1 }}：{{ res.text }}
  </span>
</template>

<script>
export default {
  name: 'ZsxtCmp2',
  components: {},
  props: ['item', 'idx'],
  data() {
    return {}
  },
  computed: {
    res() {
      if (this.item.result === '') {
        return {
          color: 'gray',
          text: '未完成',
        }
      } else {
        const isRight = this.item.result == this.item.num1 + this.item.num2
        return {
          color: isRight ? 'green' : 'red',
          text: isRight ? '正确' : '错误',
        }
      }
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>

<style lang="less" scoped></style>
